﻿/**********************************************************************
 * @file   GUIJunctionDialogBase.h
 * @brief  连接对话框基类
 * @author BaGuijun (baguijun@163.com)
 * @date   2025-02-08
 *********************************************************************/
#ifndef GUIJunctionDialogBase_H_
#define GUIJunctionDialogBase_H_

#include "GUIJunctionDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"

namespace EventOper {
    class ParaWidgetInterfaceOperator;
}

namespace GUI
{
    /**
     * @brief  连接对话框基类
     * @author BaGuijun (baguijun@163.com)
     * @date   2025-02-08
     */
    class GUIJunctionDialogAPI GUIJunctionDialogBase : public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @param[i] dataID                           数据对象ID
         * @param[i] oper                             操作器
         * @param[i] isCreate                         是否是创建模式
         * @param[i] parent                           界面父对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        GUIJunctionDialogBase(int dataID, EventOper::ParaWidgetInterfaceOperator * oper, bool isCreate, QWidget* parent = nullptr);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        virtual ~GUIJunctionDialogBase() = default;
    public slots:
        ;
        /**
         * @brief    确定事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void accept() override;
        /**
         * @brief    取消事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void reject() override;
    protected:
        /**
         * @brief    显示事件重写
         * @param[i] event                 事件对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void showEvent(QShowEvent *event) override;
        /**
         * @brief    取消高亮
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void disHight();
    protected:
        /**
         * @brief  操作器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-12
         */
        EventOper::ParaWidgetInterfaceOperator* _oper = nullptr;
        /**
         * @brief  是否为创建模式
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        bool _isCreate = false;
        /**
         * @brief  当前数据id
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        int _currentDataID = -1;
    };
}

#endif
